package br.edu.oxente.buzz.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 *
 * @author Nigini A. Oliveira - ensino@nigini.com.br
 */
@Entity(name="UserBuzz")
public class User implements Serializable {

	@Id
	private String login;

	@Column
	private String password;

	protected User(){}
	
	public User(String login, String password) {
		this.login = login;
		this.password = password;
	}

	public String getLogin() {
		return login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String toString() {
		return "USER: " + getLogin();
	}

	@Override
	public boolean equals( Object o ) {
		if ( o instanceof User ) {
			User u = (User) o;
			return u.getLogin().equals( this.getLogin() );
		}
		return false;
	}

}
